package emu.decvices.save;

import emu.decvices.apu.APU;
import emu.decvices.bus.BUS;
import emu.decvices.bus.IRQLine;
import emu.decvices.cartridge.Cartridge;
import emu.decvices.clock.Clock;
import emu.decvices.cpu.CPU;
import emu.decvices.cpu.RAM;
import emu.decvices.joy.JoyPad;
import emu.decvices.ppu.PPU;

import java.io.File;
import java.io.Serializable;

public class Save implements Serializable {
    private BUS cpuBus;//CPU总线
    private BUS ppuBus;//PPU总线

    private CPU cpu;//6502CPU
    private RAM cpu_ram;//连接在CPU上的RAM

    private PPU ppu;//2c02PPU

    private APU apu;

    private Cartridge cartridge;//游戏卡带

    private Clock clock;//时钟

    private JoyPad joyPad1;//1p手柄
    private JoyPad joyPad2;//2p手柄

    private File currentRomFile;//当前选择的rom文件

    private IRQLine line;

    public Save(BUS cpuBus, BUS ppuBus, CPU cpu, RAM cpu_ram, PPU ppu, APU apu, Cartridge cartridge, Clock clock, JoyPad joyPad1, JoyPad joyPad2, File currentRomFile) {
        this.cpuBus = cpuBus;
        this.ppuBus = ppuBus;
        this.cpu = cpu;
        this.cpu_ram = cpu_ram;
        this.ppu = ppu;
        this.apu = apu;
        this.cartridge = cartridge;
        this.clock = clock;
        this.joyPad1 = joyPad1;
        this.joyPad2 = joyPad2;
        this.currentRomFile = currentRomFile;
        line = IRQLine.getInstance();
    }

    public BUS getCpuBus() {
        return cpuBus;
    }

    public void setCpuBus(BUS cpuBus) {
        this.cpuBus = cpuBus;
    }

    public BUS getPpuBus() {
        return ppuBus;
    }

    public void setPpuBus(BUS ppuBus) {
        this.ppuBus = ppuBus;
    }

    public CPU getCpu() {
        return cpu;
    }

    public void setCpu(CPU cpu) {
        this.cpu = cpu;
    }

    public RAM getCpu_ram() {
        return cpu_ram;
    }

    public void setCpu_ram(RAM cpu_ram) {
        this.cpu_ram = cpu_ram;
    }

    public PPU getPpu() {
        return ppu;
    }

    public void setPpu(PPU ppu) {
        this.ppu = ppu;
    }

    public APU getApu() {
        return apu;
    }

    public void setApu(APU apu) {
        this.apu = apu;
    }

    public Cartridge getCartridge() {
        return cartridge;
    }

    public void setCartridge(Cartridge cartridge) {
        this.cartridge = cartridge;
    }

    public Clock getClock() {
        return clock;
    }

    public void setClock(Clock clock) {
        this.clock = clock;
    }

    public JoyPad getJoyPad1() {
        return joyPad1;
    }

    public void setJoyPad1(JoyPad joyPad1) {
        this.joyPad1 = joyPad1;
    }

    public JoyPad getJoyPad2() {
        return joyPad2;
    }

    public void setJoyPad2(JoyPad joyPad2) {
        this.joyPad2 = joyPad2;
    }

    public File getCurrentRomFile() {
        return currentRomFile;
    }

    public void setCurrentRomFile(File currentRomFile) {
        this.currentRomFile = currentRomFile;
    }

    public IRQLine getLine() {
        return line;
    }

    public void setLine(IRQLine line) {
        this.line = line;
    }
}
